let app = getApp();

Component({
    options: {
        addGlobalClass: true,
    },
    /**
     * 组件的属性列表
     */
    properties: {
        tab_list: {
            type: Array,
            value: [
                { id: 1, name: 'home' },
                { id: 2, name: 'infCircle' },
                { id: 3, name: 'video' },
                { id: 4, name: 'userCentr' }
            ]
        },
        active: {
            type: Number,
            value: 0
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        lang: null
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onClickTab(event) {
            let item, index
            item = event.currentTarget.dataset.item
            index = event.currentTarget.dataset.index
            this.triggerEvent("onChangeTab", { item: item, index: index }, {})
        }
    },

    lifetimes: {
        attached: function () { 
            this.setData({ lang: app.globalData.lang })
        } 
    }
})
